package Framework;

import java.util.ArrayList;
import java.util.List;

/**
 * @author gao
 * @date 2025/11/2 20:43
 */

public class Demo3 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("hello");
        list.add("Java");
        list.add("lambda");

        list.sort((str1, str2) -> str1.length() - str2.length());
        System.out.println(list);
    }
}